﻿

// =================================================================== 
// Module说明
//====================================================================
// 创建时间：2018-12-17 12:31:26
// 负责人：liucx
// ===================================================================

using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using OF.Component.DTO;
using OF.Component.Model;
using System.Data;

namespace OF.Component.IDAL
{

    /// <summary>
    ///通知消息 数据访问层接口  
    /// </summary>
    internal partial interface IMessage
    {

        /// <summary>
        /// 根据断言条件获取单个通知消息
        /// </summary>
        MessageInfo QuerySingle(Expression<Func<MessageInfo, bool>> predicate);
        /// <summary>
        /// 根据断言条件获获取通知消息列表
        /// </summary>
        IList<MessageInfo> QueryList(Expression<Func<MessageInfo, bool>> predicate);
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        IList<MessageInfo> SearchList(MessageCondition condition);

        /// <summary>
        /// 分页查询信息
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="regStatus">状态</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="pageCount">总数</param>
        /// <returns></returns>
        DataTable GetMessageTypePage(int userID, int messageType, int pageIndex, int pageSize, out int pageCount);

        /// <summary>
        /// 设置消息已读
        /// </summary>
        /// <param name="messageID">消息ID</param>
        /// <returns></returns>
        int SetMessageRead(long messageID);

        /// <summary>
        /// 发送所有用户消息
        /// </summary>
        /// <param name="msgId"></param>
        /// <returns></returns>
        bool SendAllUserMessage(long msgId);

        /// <summary>
        /// 获取未读消息并设置未已读
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        DataTable GetMessagePush(int userID);      

        /// <summary>
        /// 根据类型分组汇总
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        DataTable GetMessageTotalType(int userID);

        /// <summary>
        /// 查询未读消息汇总
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        int GetMessageTotal(int userID);

        /// <summary>
        /// 获取未读消息
        /// </summary>
        /// <returns></returns>
        DataTable GetAllMessagePush();
    }


}